#include "InstExer.h"

InstExer::InstExer(sc_module_name name) : sc_module(name) {
    target_socket.register_b_transport(this, &InstExer::recieveInst);

    SC_THREAD(sendPC);

    pc = 0;
}

void
InstExer::recieveInst(tlm::tlm_generic_payload &payload, sc_core::sc_time &delay_time) {
    Inst *i = reinterpret_cast<Inst *>(payload.get_data_ptr());
    pc = i->exec();

    payload.set_data_ptr(reinterpret_cast<unsigned char *>(&pc));

    std::cout << "InstExer got the data" << std::endl;

    payload.set_response_status(tlm::TLM_OK_RESPONSE);

    return;
}

void
InstExer::sendPC() {

}
